#include <REGX52.H>
#include "OneWire.h"

#define skipRom 0xCC
#define convertT 0x44
#define readT 0xBE
void B20_ConvertT()
{
	OneWire_Init();
	OneWire_SendByte(skipRom);
	OneWire_SendByte(convertT);
}
float B20_ReadT()
{
	unsigned char TLSB,TMSB;
	float t;
	int temp;
	OneWire_Init();
	OneWire_SendByte(skipRom);
	OneWire_SendByte(readT);
	TLSB=OneWire_ReadByte();
	TMSB=OneWire_ReadByte();
	temp=(TMSB<<8)|TLSB;
	t=temp/16.0;
	return t;
}